package com.lwf.smartseniorcare.repository;

import com.lwf.smartseniorcare.entity.ActivityRecord;
import com.lwf.smartseniorcare.entity.Elderly;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface ActivityRecordRepository extends JpaRepository<ActivityRecord, Long> {
    List<ActivityRecord> findByElderlyOrderByActivityDateDesc(Elderly elderly);
    List<ActivityRecord> findByElderlyAndActivityDateBetween(Elderly elderly, Date startDate, Date endDate);
    List<ActivityRecord> findByElderlyAndActivityType(Elderly elderly, String activityType);
    List<ActivityRecord> findTop10ByElderlyOrderByActivityDateDesc(Elderly elderly);
}
